﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UIT.Controls.Containers;
using System.Xml;

namespace UIT.Web.Renderers
{
    class WrapPanelRenderer : ControlRenderer<WrapPanel>
    {
        private XmlWriter writer;
        public override void Initialize(RendererManager manager, object userObject)
        {
            base.Initialize(manager, userObject);
            writer = userObject as XmlWriter;
        }

        public override void Render(WrapPanel control)
        {
            writer.WriteStartElement("div");
            writer.WriteAttributeString("class", "wrappanel");
            foreach (var item in control.Children)
                Manager.Render(item);
            writer.WriteEndElement();
        }
    }
}
